package itheima.zuoye.Test7;

import java.math.BigDecimal;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Cad jin = new Jin("G001", "张三", "123456789", 1000);
        Cad yin = new Yin("G002", "李四", "123456789", 1000);
        System.out.println("请选择：1.金卡会员 2.银卡会员");
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        switch (a) {
            case 1:
                print(jin);
                break;
            case 2:
                print(yin);
                break;
            default:
                System.out.println("输入错误！");
        }

    }
    public static void print(Cad cads) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入支付金额：");
        BigDecimal amount = sc.nextBigDecimal();
        //使用卡进行支付
        cads.pay( amount);
        System.out.println("支付成功！");




        }

    }


